package com.netjava.service.impl;

import java.util.List;

import com.netjava.dao.IPreauctionDAO;
import com.netjava.pojo.Preauction;
import com.netjava.service.IPreauctionService;
/**
 * 即将拍卖的商品的业务的实施类。
 * @author nana
 *
 */
public class PreauctionService implements IPreauctionService {

	private IPreauctionDAO preauctionDao;
	public Preauction addPreauction(Preauction preauction) {
		preauctionDao.save(preauction);
		return preauction;
	}

	public void delete(Preauction preauction) {
		preauctionDao.delete(preauction);
	}

	public Preauction getPreaucById(Integer id) {
		return preauctionDao.findById(id);
	}

	public IPreauctionDAO getPreauctionDao() {
		return preauctionDao;
	}

	public void setPreauctionDao(IPreauctionDAO preauctionDao) {
		this.preauctionDao = preauctionDao;
	}

	public List<Preauction> getAllPreauc() {
		List<Preauction> preList=preauctionDao.findAll();
		return preList;
	}
	public List<Preauction> getAllByASC(){
		return preauctionDao.getAllByASC();
	}
	

}
